#pragma once
#include <string>
#include <vector>
#include <cstdint>

struct stock_analyzer_data {
    double currentPrice;     // 当前股票价格
    double openPrice;        // 当前股票开盘价
    //double availableCash;    // 可用现金
    //int currentPosition;     // 当前持仓数量
    double ma5;
    double ma10;
    double ma20;
    double ma120;
    double lastMa5;// 为计算均线的斜率
    double lastMa10;
    double lastMa20;
    // double ma90DaysHeigh;
    // double ma90DaysLow;
    double lastDayPrice;
    double macd;
    double kdj_j;
    double kdj_last_j;
    double macd_signal;
    double macd_histogram;
    double lastMacd;
    double lastMacd_signal;
    double vol;
    double lastVol;
    double volMa60;
    std::string date;
    bool isHammerOrStar;
    bool isLargeVolumeWashout;
    bool isLargeVolumeSellout;
    bool isKDJCross;
    bool isKDJGoldenCross;
    bool isOversold;// 超卖
    bool isAfterOversold;//超卖后的一个叉 胜率只有0.0475305
    bool isOverbought;// 胜率 0.37224
    bool isMACDPositive;// MACD 是正数,且大于MACDSignal线
    bool isMACDGoUp;// MACD是否是上涨的状态
    bool new_lows_and_bottoms_diverge;// 新低且底背离
    float arrange_value;// 排序的依据
    // std::vector<double> macd_valleys;// 最近的各个谷
    // std::vector<double> macd_valleys_price;// 谷对应的价格
    // 背离:
    double macd_ma30_level;
    double price_ma30_level;
    double macd_depart;
    uint16_t macd_depart_consecutive_days;
    uint16_t macd_depart_consecutive_days_of_gains;
    uint16_t macd_depart_speed_up_days;
    bool has_depart_speed_up=false;
    double macd_activity_rate;
    std::vector<std::pair<std::string,double>> ma120Area;// 120日线与价格线构成的面积
};
